#ifndef PLAYER_H
#define PLAYER_H

#include <SFML/Graphics.hpp>
#include <iostream>
#include <math.h>
#include "Animation.h"
#include "Entity.h"
#include "Utility.h"

#define _USE_MATH_DEFINES

class Player : public TestEntity
{
    public:
        Player(b2World* world, int type, sf::Vector2f pos, std::string file, float scalar = 1.0, float rotation = 0);
        virtual ~Player();
        void Update();
        void Render(sf::RenderWindow&);
        void setFacingImage();
        void startMoving(b2Vec2);
        void stopMoving();
        sf::Vector2f getPosition();
        sf::CircleShape* getVisionCircle();
        sf::RectangleShape getRect();
        void setSpeed(b2Vec2);
        float getCurrentSpeed();
        float getVelocity();
        bool isMoving();
        int getMapIndex();
        void setCurrentMap(int);
        float getDistanceMoved();
        void setEnergy(int);
        int getEnergy();
        int getMaxEnergy();
        void setSupplies(int);
        int getSupplies();
        int getMaxSupplies();
        void setPosition(sf::Vector2f);



    protected:

    private:

        sf::CircleShape visionCircle;
        int playerWidth;
        int playerHeight;
        float32 playerDensity;
        float32 playerFriction;
        float32 playerLinearDamping;
        float32 playerAnimationDamping;
        int playerTile;
        float32 direction;
        float playerVelocityRate; //speed over movement
        int currentMap;

        sf::Vector2f start;
        sf::Vector2f stop;

        //Player Stats
        int maxEnergy;
        int energy;
        int maxSupplies;
        int supplies;

        int playerFrameRate;

        const double PI = std::atan(1.0)*4;

};

#endif // PLAYER_H
